//index.js  
//获取应用实例  
var app = getApp()
Page({
  data: {
    // tab切换  
    selected: 0,
  },
  onLoad: function () {
    var that = this;
    /** 
     * 获取系统信息 
     */
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          screenWidth: res.screenWidth,
          screenHeight: res.screenHeight
        });
      }
    });
  },
  /** 
   * 点击tab切换 
   */
  swichNav: function (e) {
    var that = this;
    if (this.data.selected === e.target.dataset.selected) {
      return false;
    } else {
      that.setData({
        selected: e.target.dataset.selected
      })
    }
    console.log(this.data.selected)

  },
  /**
   * 跳转内容页
   */
  tapcont: function (e){
    var fl = e.currentTarget.dataset.fl;
    var flist = e.currentTarget.dataset.flist;
    var box = e.currentTarget.dataset.box;
    var list = e.currentTarget.dataset.list;
    var htmlsrc;
    if (flist!=""){
      htmlsrc = "../jksclist/"+ flist + box + "-" + list;
    }else{
      htmlsrc = "../docdata/" + fl + "/" + fl + box + "-" + list;
    }
    console.log(htmlsrc)
    wx.navigateTo({
      url: htmlsrc
    })
  },
  toolscont: function (e) {
    var fl = e.currentTarget.dataset.fl;
    var toolsname = e.currentTarget.dataset.toolsname;
    var htmlsrc = "../tools/" + fl + "/" + toolsname;
    console.log(htmlsrc)
    wx.navigateTo({
      url: htmlsrc
    })
  }
})